home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Snippets / Platforms & Tools / MacApp / AEGestalt 1.0b3 / UAEGestalt.cp < prev    next >
Encoding:
Text File  |  1991-12-11  |  1.8 KB  |  69 lines  |  [TEXT/MPS ]

  1. //     UAEGestalt.cp 
  2. //     Copyright © 1991 by Apple Computer, Inc. All rights reserved.
  3. //    Kent Sandvik DTS
  4. //    This file contains the basic TAEApplication member functions
  5.  
  6.  
  7. // INCLUDES 
  8.  
  9. #ifndef __AEGESTALT__
  10. #include "UAEGestalt.h"                                        // class definitions
  11. #endif
  12.  
  13. // TAEApplication
  14.  
  15. //    Empty constructor - for avoiding ptabs in global data space
  16. #pragma segment ARes
  17. TAEApplication::TAEApplication() {}                    
  18.  
  19. //    Initialize the Application object
  20.  
  21. #pragma segment AInit
  22. pascal void TAEApplication::IAEApplication(OSType fileType, OSType creator)
  23. {
  24.     inherited::IApplication(fileType, creator);
  25.  
  26.     if (gDeadStripSuppression){                                // so the linker doesn't dead strip class info 
  27.         macroDontDeadStrip(TLabelView);
  28.         macroDontDeadStrip(TInformationView);
  29.         macroDontDeadStrip(TGrayFill);
  30.     }
  31.         RegisterStdType("TGrayFill", 'gray');                // register adorner types
  32. }
  33.  
  34.  
  35. //    Create a new TDocument from the class
  36.  
  37. #pragma segment AOpen
  38. pascal TDocument* TAEApplication::DoMakeDocument(CommandNumber     /* itsCmdNumber */,
  39.                                                  TFile*           /* itsFile */)
  40. {
  41.         TAEDocument* aAEDocument = new TAEDocument;
  42.         aAEDocument->IAEDocument();
  43.         return aAEDocument;
  44. }
  45.  
  46.  
  47. //    Handle incoming AppleEvents calls, in our case to the TAEServerCommand
  48.  
  49. #pragma segment ASelCommand
  50. pascal void TAEApplication::DoAppleCommand(CommandNumber theNumber,
  51.                                             const AppleEvent& message,
  52.                                             const AppleEvent& reply)
  53. {
  54.     switch(theNumber)
  55.     {
  56.     // case Gestalt server AE, create a command from the AE, and post it!
  57.     case cAEProvideGestaltInfo:
  58.         TAEServerCommand* aCommand = new TAEServerCommand;
  59.         aCommand->InitializeFromAppleEvent(theNumber, this, kCantUndo,
  60.                                             kDoesNotCauseChange, NULL, message, reply);
  61.         this->PostAnEvent(aCommand);
  62.         break;
  63.         
  64.         default:
  65.             inherited::DoAppleCommand(theNumber, message, reply);
  66.     }
  67. }
  68.  
  69.